<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ระบบประกันคุณภาพการผลิต :: QI Management</title>
<script src="<?php echo base_url();?>js/knockout-1.2.1.js"></script>
<script src="<?php echo base_url();?>js/jquery-1.7.1.min.js"></script>
<script src="<?php echo base_url();?>js/kendo.dataviz.min.js"></script>
<script src="<?php echo base_url();?>js/kendo.all.min.js"></script>
<link href="<?php echo base_url();?>css/kendo.common.min.css" rel="stylesheet" />
<link href="<?php echo base_url();?>css/kendo.default.min.css" rel="stylesheet" />
<link href="<?php echo base_url();?>css/t-tech.css" rel="stylesheet" />
<style type="text/css">
body {
	background-color: #00597E;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
</style>
</head>
<body>
<table width="100%" align="center" background="<?php echo base_url();?>css/wallpaper.png">
  <tr>
    <td height="1000" align="center" valign="top"><p>
    </p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <h1 class="with"><img src="<?php echo base_url();?>images/LoGo_SCGPaper.png" /><br />
      ระบบประกันคุณภาพการผลิต</h1>
      <table width="600" class="table" background="<?php echo base_url();?>css/bg-table.png">
        <tr>
          <td>
          <br />
          <strong><div align="center" id="loading" class="red"></div></strong>
          <br />
          <table width="339" align="center">
            <tr>
              <td width="113" height="35" align="right" class="with"><strong>Username&nbsp;:</strong></td>
              <td width="214" height="35"><input id="username" class="k-textbox" /></td>
            </tr>
            <tr>
              <td height="35" align="right" class="with"><strong>Password&nbsp;:</strong></td>
              <td height="35"><input type='password' class="k-textbox" id="password" /></td>
            </tr>
          </table>
            <p align="center">
              <button class="k-button" id="login">เข้าสู่ระบบ</button>
          </p></td>
        </tr>
      </table></td>
  </tr>
</table>
<script>
            $(document).ready(function() {
                	 var loading = "<center><img src='<?=base_url(); ?>image/BlueOpal/loading-image.gif?>'></center>"
                	 $("#login").click(function() {
                		 $.ajax({
								url:"<? echo base_url()?>index.php/login/checkLogin",
								type: 'post',
								data : ({
										type : "person" , 
										username : $("#username").val(),										
										password : $("#password").val(),
									 
										}) ,
								beforeSend: function(){
											$(".status").html(loading);
										},
								success : function(rs){
										  // alert(rs);
											if(rs == '1'){
												$("#loading").html(loading);
												window.location="<? echo base_url()?>index.php/application/";
											}else{
												$("#loading").html('ตรวจสอบ Username และ Password ใหม่');
											// 	apprise('user มีผู้ใช้แล้ว', {'animate':true});
											}
										}	  
                		 	  });
                	 });
                });

 </script>
</body>
</html>